<?php
    include('init.php');

    $rss = $db->query('SELECT * FROM hs_category ORDER BY c_id');
    $cat_list = '';
    $cat_search_list = '';
    $i = 1;
    $list = explode('/',$_SERVER["SCRIPT_FILENAME"]);
    $file_name = end($list);
    if($file_name=='product.php'){
	$pid = $_GET['id'];
    }
    while ($line = $db->fetchNextObject($rss)){
	$selected = '';
	if($line->c_id==$pid){
	    $selected = 'selected="selected"';
	}
        $cat_list .= '<li id="footer_menu_'.($i++).'"><a href="product.php?id='.$line->c_id.'" title="'.$line->c_name.'">'.$line->c_name.'</a></li>';
	$cat_search_list .= '<option '.$selected.' value="'.$line->c_id.'">'.$line->c_name.'</option>';
    }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Hong Chiao</title>
        <meta name="description" content="" />
	<meta name="keywords" content="" />
	<!--<link rel="shortcut icon" href="images/favicon.ico" />-->
        <script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
	<script type="text/javascript" src="js/js.func.js"></script>
        
        <link rel="stylesheet" type="text/css" href="css/reset.css" />
        <link rel="stylesheet" type="text/css" href="css/global.css" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
	
	<!--<link href="css/dropdown/themes/default/helper.css" media="screen" rel="stylesheet" type="text/css" />-->
	<link href="css/dropdown/dropdown.css" media="screen" rel="stylesheet" type="text/css" />
	<link href="css/dropdown/themes/default/default.ultimate.css" media="screen" rel="stylesheet" type="text/css" />
	
	
	<script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox-1.3.4.css" />
	
	
	<!--<script type="text/javascript" src="js/jquery.dropdown.js"></script>-->
	
    </head>
    <body>
        <div id="wrapper">
            <div id="header">
                <div id="logo">
                    <a href="index.php" title="Hongchiao"><img src="images/logo.jpg" alt="Hongchiao" class="img_link" /></a>
                </div>
                <div id="header_right" class="display_none_">
                    <!--<div id="header_menu">
                        <a href="" title="Checkout">Checkout</a>
                        <a href="" title="Create an Account">Create an Account</a>
                        <a href="" title="Login">Login</a>
                    </div>
                    <div id="currency_select">
                        <label>Currencies : </label>
                        <select name="head_currency" id="head_currency">
                            <option>US Dollar</option>
                            <option>TH Bath</option>
                        </select>
                        <input type="submit" id="head_bt" value="Change" />
                    </div>-->
		    <div id="login_box" <?php if(isset($_SESSION['m_id'])){ echo 'class="display_none"'; } ?>>
			<form id="login_frm">
			<div class="login_box">
			    <span>email :</span> <input type="text" name="email" id="email" />
			</div>
			<div class="login_box">
			    <span>password :</span> <input type="password" name="password" id="password" />
			</div>
			</form>
			<div class="login_box" id="login_bt_box">
			    <span>&nbsp;</span> <button id="login_bt">Log in</button> <a href="forget_password.php" title="Forget password?" >Forget password?</a>
			</div>
			<div class="login_box display_none" id="login_indicator">
			    <span>&nbsp;</span><img src="images/ajax-loader.gif" />
			</div>
		    </div>
		    <div id="user_box" <?php if(!isset($_SESSION['m_id'])){ echo 'class="display_none"'; } ?>>
			Welcome <a href="user-info.php" title="user info"><?php echo $_SESSION['m_name'],' ',$_SESSION['m_lastname']; ?></a> , <a href="javascript:void(0)" title="Log out" id="logout_bt">Log out</a>
		    </div>
                </div>
                <div class="clear">&nbsp;</div>
            </div>
            <div class="clear">&nbsp;</div>
            
            <div id="top_menu">
                <ul class="dropdown">
                    <li id="top_menu_1" <?php if($top_menu_1){ echo 'class="current"';} ?>><a href="index.php" title="Home">Home</a></li>
                    <li id="top_menu_2" <?php if($top_menu_2){ echo 'class="current"';} ?>><a href="company-profile.php" title="About Us">About Us</a></li>
                    <li id="top_menu_3" <?php if($top_menu_3){ echo 'class="current"';} ?>>
			<a href="gallery.php">Gallery</a>
		    </li>
                    <li id="top_menu_4" <?php if($top_menu_4){ echo 'class="current"';} ?>><a href="news-event.php" title="News &amp; Event">News &amp; Event</a></li>
                    <li id="top_menu_5" <?php if($top_menu_5){ echo 'class="current"';} ?>><a href="contact-us.php" title="Contact Us">Contact Us</a></li>
                    <li id="top_menu_6" <?php if($top_menu_6){ echo 'class="current"';} ?>><a href="cart.php" title="Order">Order</a></li>
                    <li id="top_menu_7" <?php if($top_menu_7){ echo 'class="current"';} ?>><a href="register.php" title="Register">Register</a></li>
                    <div class="clear">&nbsp;</div>
                </ul>
            </div>